#!/usr/bin/env python3

import math

#Get angle needed to contain origin. If actual angle > needed then it contains origin

#read data
f = open("triangles.txt","r")
data = []
for line in f.readlines():
    triangle = line.strip().split(",")
    d = []
    for x in range(3):
        d.append((int(triangle[x*2]),int(triangle[(x*2)+1])))
    data.append(d)
#data stored in data

def angle(seg1,seg2):
    len1 = ((seg1[0][1]-seg1[1][1])**2+(seg1[0][0]-seg1[1][0])**2)**.5
    len2 = ((seg2[0][1]-seg2[1][1])**2+(seg2[0][0]-seg2[1][0])**2)**.5
    len3 = ((seg1[1][1]-seg2[1][1])**2+(seg1[1][0]-seg2[1][0])**2)**.5
    return math.acos((len1**2 + len2**2 - len3**2)/(2*len1*len2))

#Check. It works! Thanks trig!
#print(math.degrees(angle(((0,0),(0,1)),((0,0),(1,0)))))
'''
triangle = data[0]
a = angle((triangle[1],triangle[0]),(triangle[1],triangle[2]))
print(math.degrees(a))
'''

def checktriangle(triangle):
    for x in range(3):
        actual = angle((triangle[(x+1) % 3],triangle[(x+0) % 3]),(triangle[(x+1) % 3],triangle[(x+2) % 3]))
        needed = angle((triangle[(x+1) % 3],triangle[(x+0) % 3]),(triangle[(x+1) % 3],(0,0)))
        if actual < needed:
            return False
    return True

total = 0
for triangle in data:
    if checktriangle(triangle):
        total += 1
print(total)